import Vue from 'vue'

//最新组件
//import Welcome from '@/page/welcome/welcome'
import Index from '@/page/index/index'
import Login from '@/page/login/login'
//企业信息
import QYXX from '@/page/Fileinfo/fileinfo'
//快检数据
import KJSJ from '@/page/fastcheck/list'
import KJSJdetail from '@/page/fastcheck/detail'
//监管记录
import JGJL from '@/page/JGJLcheck/list'
import Guidedetail from '@/page/JGJLcheck/guidedetail'
//通知公告
import TZGG from '@/page/publicNotice/publicNoticelist'
import PublicNoticedetail from '@/page/publicNotice/PublicNoticedetail'
//视频查看
import SPJK from '@/page/video/videolist'

//规范经营
import GFJY from '@/page/index/list'

//出货记录
import Chjllist from '@/page/chjl/chjllist'
import Chjllistdetail from '@/page/chjl/chjllistdetail'
import Chjllistadd from '@/page/chjl/chjllistadd'
import Chjllistupdate from '@/page/chjl/chjllistupdate'


//食品留样
import Splylist from '@/page/sply/splylist'
import Splylistdetail from '@/page/sply/splylistdetail'
import Splylistadd from '@/page/sply/splylistadd'
import Splylistupdate from '@/page/sply/splylistupdate'
/****************************结束*************************** */

//个人中心
import GRZX from '@/page/personal/personallist'





//内容页展示区域
const root = Vue.component('root', {
  template: '<router-view></router-view>'
});

let routes = [


  {
    path: '/',
    name: 'Login',
    component: Login,
    meta: {
      requiresAuth: true,
      hidden: true
    }
  }, {
    path: '/',
    component: root,
    meta: {
      requiresAuth: true
    },
    children: [
      {
        path: 'index',
        name: 'Index',
        component: Index,
      }, {//快检数据
        path: 'KJSJ',
        name: 'KJSJ',
        component: KJSJ,
      }, {//快检数据详情
        path: 'KJSJdetail',
        name: 'KJSJdetail',
        component: KJSJdetail,
      }, {
        //视频查看
        path: 'videolist',
        name: 'SPJK',
        component: SPJK,
      }, {//监管记录
        path: 'JGJL',
        name: 'JGJL',
        component: JGJL,
      },
      {
        path: 'guidedetail',
        name: 'Guidedetail',
        component: Guidedetail,
      },
      {//通知公告
        path: 'publicNoticelist',
        name: 'TZGG',
        component: TZGG,
      }, {
        path: 'publicNoticedetail',
        name: 'PublicNoticedetail',
        component: PublicNoticedetail,
      },
      {
        path: 'list',
        name: 'GFJY',
        component: GFJY
      }, {//出货记录
        path: 'chjllist',
        name: 'Chjllist',
        component: Chjllist
      }, {
        path: 'chjllistdetail',
        name: 'Chjllistdetail',
        component: Chjllistdetail
      }, {
        path: 'chjllistadd',
        name: 'Chjllistadd',
        component: Chjllistadd
      }, {
        path: 'chjllistupdate',
        name: 'Chjllistupdate',
        component: Chjllistupdate
      }, {//食品留样
        path: 'splylist',
        name: 'Splylist',
        component: Splylist
      }, {
        path: 'splylistdetail',
        name: 'Splylistdetail',
        component: Splylistdetail
      }, {
        path: 'splylistadd',
        name: 'Splylistadd',
        component: Splylistadd
      }, {
        path: 'splylistupdate',
        name: 'Splylistupdate',
        component: Splylistupdate
      }, {//档案信息
        path: 'fileinfo',
        name: 'QYXX',
        component: QYXX,
      },{
        //个人中心
         path: 'personallist',
         name: 'GRZX',
         component: GRZX,
      }
    ]
  }
]


routes[1].children.forEach(route => {
  if (route.children) {
    if (!route.meta) {
      route.meta = {};
    }
    route.meta.children = route.children;
  }
});

export default routes;

